package com.dgut.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
@Data
@ApiModel("用户")
public class User {
    @ApiModelProperty("用户id")
    private Long id;
    @ApiModelProperty("用户名字")
    private String username;

    @JsonIgnore//不参与序列化返回
    private String password;
    @ApiModelProperty("用户昵称")
    private String nickname;
    @ApiModelProperty("用户手机号码")
    private String phoneNum;
    @ApiModelProperty("用户邮箱")
    private String email;
    @ApiModelProperty("用户性别")
    private Byte gender;

    @JsonIgnore//不参与序列化返回
    private String salt;

    @JsonInclude(JsonInclude.Include.ALWAYS)//任何时候都要参与序列化,无论是否为空
    @ApiModelProperty("用户头像地址")
    private String avatarUrl;
    @ApiModelProperty("用户文章数量")
    private Integer articleCount;
    @ApiModelProperty("是否管理员")
    private Byte isAdmin;
    @ApiModelProperty("个人简介")
    private String remark;
    @ApiModelProperty("用户状态")
    private Byte state;
    @JsonIgnore//不参与序列化返回
    @ApiModelProperty("用户删除状态")
    private Byte deleteState;
    @ApiModelProperty("用户创建时间")
    private Date createTime;
    @ApiModelProperty("用户更新时间")
    private Date updateTime;


}